console.log("content script 简书 loaded");


function injectCustomJs(jsPath)
{
    jsPath = jsPath || 'js/share.js';
    var temp = document.createElement('script');
    temp.setAttribute('type', 'text/javascript');
    // 获得的地址类似：chrome-extension://ihcokhadfjfchaeagdoclpnjdiokfakg/js/inject.js
    temp.src = chrome.extension.getURL(jsPath);
    temp.onload = function()
    {
        // 放在页面不好看，执行完后移除掉
        this.parentNode.removeChild(this);
    };
    document.body.appendChild(temp);
}

console.log("insert jquery");
injectCustomJs("js/jquery-3.6.0.js");

setTimeout(()=>{
    let iframes = document.querySelectorAll('iframe');
    for(let i of iframes){
        i.remove();
    }
},10000);

// document.addEventListener("load",()=>{
//     let iframes = document.querySelectorAll('iframe');
//     for(let i of iframes){
//         i.remove();
//     }
// });


